package com.dubbo.consumer.controller;

import com.dubbo.api.TestService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    // 启动的时候不检查，有时提供者可能还没启动，而消费者先启动
    @Reference(check = false)
    private TestService testService;

    @GetMapping("/dubbo/{name}")
    public String test(@PathVariable String name){
        return testService.test(name);
    }
}
